<template>
  <!-- 头部 -->
  <div>
    <div class="book_top ">
      <ul class="book_top_menu">
        <li>
         
        </li>
        <li>
          <router-link tag="span" to="/bookshelf" class="iconfont icon-B"></router-link>
          <router-link tag="span" to="/my" class="iconfont icon-B2"></router-link>
          <router-link tag="span" to="/search" class="iconfont icon-B1"></router-link>
        </li>
      </ul>
      <div style="text-align:center;">
        <ul class="book_top_Nav">
          <li>推荐</li>
          <router-link to="/Vip" tag="li">VIP</router-link>
          <router-link tag="li" to="/new">更新</router-link>
          <li class="book_top_Nav_up">书评</li>
          <router-link tag="li" to="/img">分类</router-link>


        </ul>
      </div>

    </div>
    <!-- 轮播图 -->
    <div id="page">
      <div class="Pinglunfont book_bk_qs1 shuping_list_space" v-for="(image, index) in  vipEnd" :key="'ifo-' + index">
        <ul id="Pinglun_body" style="margin:0.1rem;">
          <li class="clear">
            <figure>
              <img :src="image.imc" width="80" height="80">
            </figure>
            <div class="Pinglun_Content2">
              <span><b>{{ image.author }}</b><br>2022-09-23 04:16</span>
            </div>
            <div style="color:#333;line-height:2em;text-align: left;">或许这才是普通人遇到病娇的爱恋</div>
            <div class="rating-container rating-gly" data-content=""
              style="margin: 0.1rem 0; text-align: left; ">
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;;color:#FBDC04;"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;color: #E3E3E3"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;color: #E3E3E3"></span>
              <span class="iconfont icon-aixin1"
                style="font-size: 14px;margin-right: -2px; width: 12px;color: #E3E3E3;"></span>


            </div>

            <p>这本书实为上乘之作，作者的文笔也非常优秀。从整体上来看，作者对于世界框架的构造无疑是极为...</p>

          </li>
        </ul>
        <router-link tag="a" :to="'./BookContent?id=' + image.id">
          <ul class="shuping_tips">
            <li><img :src="image.imc"></li>
            <li>罪人莉莉丝的救赎重生<em>{{ image.orangeNum }}</em><br><span>悪役令嬢 / 校园</span></li>
          </ul>
        </router-link>
        <ul class="shuping_hudong book_bk_qs1" style="border-bottom-width:0px;">
          <router-link tag="li" to="/list"><span class="iconfont icon-detailscomments"></span> </router-link>
          <li cid="13581626">


            <span class="iconfont icon-dianzan" @click="like2(image)" v-show="!image.like2"></span>
            <span class="iconfont icon-dianzan" @click="like2(image)" v-show="image.like2" style="color:#EF9965"></span>

            <label>{{ image.num }}</label>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>
  
  
<script>
// import "../assets/font/iconfont";
// import Swiper from "swiper";
import { getJsonData } from '@/api/home';

export default {
  data() {
    return {
      activeName: 'a',
      indexSwiper: 0,
      images1: null,
      newVip: null,
      vipEnd: null,
      bookId: null,
      orangeNum: null,
      num: null,
      show: false,
    };
  },
  created() {
 // 获取json数据
    getJsonData().then(data => {
      console.log(data);
      this.images1 = data.vip1
      this.newVip = data.newvip
      this.vipEnd = data.vipEnd

    });

  },
  methods: {
    // 点赞
    like2(image) {
      image.like2 = !image.like2
      if (image.like2 == true) {
        image.num += 1
      } else {
        image.num -= 1
      }
    },

    onChange(index) {
      this.indexSwiper = index;
    }
  }

}
</script>
  
  
  
<style lang="scss">
#page {
  margin-top: 93.6px;
}

.fengtui_list {
  font-size: 0;
}

.fengtui_list li {
  display: inline-block;
  width: 30.1%;
  margin-left: 2.4%;
  text-align: center;
  vertical-align: top;
}

.fengtui_list li img {
  margin-bottom: 0.02rem;
  width: 100%;
}

body {
  background-color: #F3F3F3;
}

p {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
}

.Linkfont li {
  color: #666;
  text-decoration: none;
  font-size: 11.718px;
}

.recommended_list li {
  display: inline-block;
  width: 22%;
  margin-left: 2.4%;
  text-align: center;
  vertical-align: top;
}

.recommended_list li img {
  margin-bottom: 2.344px;
  width: 100%;
}

.recommended_list {
  font-size: 0;
}


.book_Content_title {
  text-align: left;
  color: #333;
  font-size: 14.062px;
  height: 35.154px;
  line-height: 35.154px;
}

.book_top {
  max-width: 750px;
  min-width: 375px;
  position: fixed;
  z-index: 90;
  width: 100%;
  top: 0;
  color: #666;
  border-top-width: 0px;
  background: #fff;
  margin: 0 auto;
}

.book_top_menu {
  margin: 5.859px 5.859px 0 5.859px;
  height: 24.608px;
  display: -webkit-box;

  li {
    display: -webkit-box;
    width: 50%;
    color: #f90;

    a {
      color: #f90;
    }

    &:last-child {
      -webkit-box-pack: end;
      -webkit-box-align: center;
    }

    span {
      font-size: 18.749px;
      padding: 0 10px;
    }
  }
}

.book_top_Nav {
  font-size: 16.405px;
  display: inline-block;

  li {
    display: inline-block;
    line-height: 46.872px;
    text-align: center;
    padding: 0 11.718px;
    border-bottom: 3px solid #fff;

    a {
      color: #666;
      display: block;
      width: 100%;
    }
  }
}

.book_top_Nav_up {
  border-bottom-color: #f90 !important;

  a {
    font-weight: bold;
    color: #f90 !important;
  }
}
</style>